package com.Jano.controller;

import com.Jano.annotation.LogAnnotation;
import com.Jano.annotation.Permission;
import com.Jano.entity.Reply;
import com.Jano.mapper.ReplyMapper;
import com.Jano.service.ReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * description: ReplyController <br>
 * date: 2022/7/13 12:47 AM <br>
 * author: zoumaoji <br>
 * version: 1.0 <br>
 */
@RestController
@RequestMapping("/reply")
public class ReplyController {
    @Autowired
    ReplyService replyService;


    @RequestMapping("/query.action")
    @Permission("/reply/query.action")
    @LogAnnotation(title = "评论模块", action = "查询指定论帖的评论")
    public List<Reply> queryReplyByInvitationId(Integer invitationId) {
        return replyService.findReplyByInvitationId(invitationId);
    }

    @RequestMapping("/update.action")
    @Permission("/reply/update.action")
    @LogAnnotation(title = "评论模块", action = "增加指定论贴评论")
    public Boolean addReply(Integer invitationId, String content, String author) {
        return replyService.addReply(invitationId, content, author);
    }
}
